<?php
@session_start();

require_once 'shared-functions.php';
require_once 'session.php';

if($_POST['username']=="" || $_POST['password']=="")
{
	$_SESSION['login_error']="Both username and password are required.";
	header("Location: login.php?page=".$_GET['page']);
	exit();
}

if(CreateSession($_POST['username'],$_POST['password']))
{
    header("Location:".$_GET['page'].".php");
}
else
{
    header("Location: login.php?page=".$_GET['page']);
    exit();
}
?>
